
package jpoco.android;

import android.view.View;
import android.view.ViewGroup;
import java.util.*;

public abstract class AbstractListAdapter<T> extends android.widget.BaseAdapter
{
	private List<T> data;
	
	public AbstractListAdapter()
	{
		super();
	}
	
	public AbstractListAdapter(List<T> l)
	{
		super();
		this.data = l;
	}
	
	public int getCount()
	{
		return (data != null) ? data.size() : -1;
	}

	public T getItem(int position)
	{
		return (data != null) ? data.get(position) : null;
	}

	public long getItemId(int position)
	{
		return position;
	}

	abstract public View getView(int position, View convertView, ViewGroup parent);

}
